Sam, this city has a rather unique way of handling borders. It is effectively split between 3 countries, but manages to function by ignoring the fact.
The airport is technically in France, but Switzerland has special extra territorial rights. Half the terminal counts as being in Switzerland, half in France. There is a line through the middle of the building, which you can walk across as long as you have a passport with you. When you land, after you pick up your luggage you can either walk through one door, past French customs into France, or through a different door, past Swiss customs into Switzerland (all in the same building). If you then leave the building by the Swiss exit, you get to a road which has special "duty free port" status. It goes direct to Basel without connecting to any French road, and you can get a Basel city bus into the city. If you exit by the French entrance, you are in France, and if you take the main Autoroute into Basel, you then go through customs at the border.
There are multiple bus routes to France and Germany (every 15 minutes), plus a tram route to Germany (every 7½ minutes) and another one under construction to France. Technically customs could stop a tram and inspect the passengers, but with 150+ people on a standing-room-only rush hour tram, they know when they are beaten.