Origin of the term is not known, nor the reason for the selection of the number 18, except to simply note the length of two regular games. Potentially, extra innings can extend indefinitely past 18, but it's rare.
"Game tonight? 18inn in effect."
"Can't risk it. Long drive ahead early tomorrow morning... family vacation... but thanks anyway!"
"I'm game. But will drive separately, just in case."