I can address part of the AF side. To be a USAF pilot, you must be an officer. This means you need at least a 4yr degree and you must go through a commissioning program. There are three main commissioning sources, the Air Force Academy (where I am), Air Force ROTC, and OTS. OTS is a 3 month (I think) training program for those who already have their degree. It can be intense as it must fit a lot of information into a short time period. The academy is a 4 year university. It is very structured and combines military, academic, and athletic training. About 40-50% of the USAF's pilot slots are given to the academy. That equates to roughly 400-500 per year, with a graduating class of just under 1000. AFROTC is a program done at a civilian college. It involves extra classes in AF history and doctrine, along with a leadership lab course. ROTC also does PT and summer training. ROTC gets quite a few pilot slots, but not quite as high a percentage, relative to the number of students, as USAFA. OTS gets relatively few pilot slots, as it focuses more on professional careers.
At USAFA and in AFROTC, each cadet is ranked on academics, military (leadership and performance), and athletics. If a cadet is medically qualified, they can select a pilot slot. However, ranking becomes important because the job possitions are picked by class rank. If you are last in your class, your options may be fairly limited. Right now, at USAFA there are about 80 cadets on the alternate pilot list because they were not ranked high enough to choose an open pilot slot first.
After commissioning and getting a pilot slot, most USAF pilots will go to Unergraduate Pilot Training at an Air Force Base. I have not done this, so I will not attempt to fully explain UPT.