Why 'a minute', can't it be 'not a second too soon', or the like?
why this phrase is equal to "on time"?
Not really 'on time'; more like 'just in the nick of time', or just barely in time. If you have been a minute later, it would have been too late.
Yes, you're exactly right, and that wording is occasionally used; but for whatever reason, the more common phrasing of the cliche is "minute".