In order to reenlist, you have to be recommended (at least, that’s how it used to work, and I’m not aware that it’s changed.) So if you were a mediocre performer, you wouldn’t necessarily be kicked out, but you might not be permitted to continue once your enlistment period was up. The phrase when I was in was “needs of the Navy” - if they didn’t need you and your skills, you were out once you met your obligations.
A sailor who worked for me was highly recommended for reenlistment, and he found out that once he did, he was going to be sent on recruiter duty. He didn’t want to do that, and he fought to get the orders changed. But it didn’t matter - the Navy needed him in the recruiter billet. So he opted to leave the Navy. He wanted to do 20, but he wanted to do it his way. Sorry, dude, that’s not how it works. You don’t get to cherry-pick your career path.
I also know that when some specialty areas were overmanned, the only way one could reenlist would be to change rate. A friend of mine had been trained as an electronics technician, but in order to stay in, she had to change to a storekeeper, since there were waaaaaay too many technicians of her seniority at the time, and she didn’t happen to be the best of the best. She made the switch and finished out her time anyway - again, needs of the Navy.
Even I faced it as an officer - shortly after I got out, in a moment of panic, I called a recruiter to see if I could get back on active duty. It turned out that in my specialty at my rank, the manning was at 115% - no way would they take me back in. Fortunately, my moment of panic passed and everything worked out…
So, if the military has to reduce its ranks due to budget cuts or any other reason, unless you happen to be among the best at what you do, you may find yourself unable to finish your 20. Your desire to serve may be strong, but needs of the service come before personal desires.