It's easy to get in the weeds on ballistics.
All good info here but in the end, if you aren't preparing for the upcoming season of Top Gun or trying to qualify at sniper school, none of this matters. Buy the least expensive brass 5.56/223 ammo and be happy. As No4 mentioned, if you are competing, buy match ammo. If long range precision is your hearts desire, I'd ask ... why are you shooting an AR?
For defensive scenarios, in most cases the perp is going to be close enough where you can smell his breath. There is no such thing as a defensive shot at 100, 200, or 500 yards.
Stating the obvious ... faster twist, better long range stability. Provided you pick the right ammo. If you listen carefully you can hear the weeds growing
Infantry weapons are designed for a specific purpose and the least common denominator: 19-20 year olds with a modest amount of training putting holes in the enemy. AR Carbine... effective range about 400 meters. Rifle, 6-700. You can spend a bunch of money to accurize and/or choose another caliber and do better, go longer. The question is why do this with a rifle designed for intermediate range.
Bullet weight and type, powder, twist, barrel length, and the skill of the shooter are all factors.
My personal preference... beyond 400 yards, get a decent bolt gun in 6.5 CRM if ringing steel out to 1000 yards or learning how to put five rounds in one ragged hole is your thing. There are a lot of affordable factory rifles now that are sub MOA. Meaning the gun is better than the person shooting it.
Most 3 gun matches... the rifle stage ... the multiple targets are between 100 and 400 meters. I've seen them as far out as 600 in pro matches. The average schlub - even if well practiced has a tough time hitting a target at 600 yards with an AR. Especially under the pressure of time. On forums there's always a guy that says he can do that blindfolded in a hurricane. Yea, right.