Audi vs BMW is a Mac vs PC, Canon vs Nikon, etc. argument. However as someone who drove BMWs for years while my employer paid for my cars but drives an Audi now I buy them, I feel qualified to explain the difference.
I traded my 2014 Audi S4 for a 2016 BMW 340i xDrive a few months ago- my answer is emphatically BMW. Audi does many things well, but BMW does many things better. For instance, my car is a top model 3-series, not an M3. Fully stock, it’s already quicker than my Audi “S” model 4, not A4. The first thing I noticed with my 340i is the transmission. When you mash the gas, it wants to be in the lowest gear possible. With my Audi, if I was going anything above 15 mph and floored it, a first gear downshift was out of the question; same as if I were going above 40 mph trying to get into 2nd gear. The BMW has a sense of urgency that just wasn’t there with the Audi. Audis are excellent cars for people who want a nice car; BMWs are excellent cars for those who really drive them.
So at the root of it, a BMW has more purpose and is more pure.
Both cars absolutely suck in reliability so if you buy either one, try to make sure it’s from a good former owner and make sure it was not manufactured on a Monday or a Friday (germans love their beer).
Also- the one main engineering difference with BMW/Audi is that BMW strikes a near perfect 50/50 balance on the weight of their cars its its promptly why they handle so well. Most Audi models you will find are very nose heavy and you can feel the difference when diving into turns.
BMW's in my opinion also have a better interior. After 10 years or so Audi's tend to really start showing their age. It's common to see a lot of wear and tear on the plastics on the door panels and dash. The carpets also need more care and protection on Audi's in comparison, BMW's show very little wear over time. This is probably one reason why BMW's keep their value so well over time. Even after 20 to 30 years, a well kept BMW can look and feel like new on the interior.