The first is gravity. When the bullet leaves the barrel it begins falling. It is subject to the effect of gravity just the same as a bullet you drop out of your hand. If your barrel was set parallel to the ground and you could drop one bullet at the exact same instant the other bullet left the barrel traveling 2700 feet per second, they would hit the ground at the same time. There is no such thing as a "flat shooting" round. All of them fall and accelerate in that fall at the exact same rate.
To compensate for that, gun and rifle sights are mounted so that the barrel is tipped up to a greater or lesser extent depending on the nominal range the weapon is designed for. If you successfully "zero" a rifle at 200 yards, you are compensating for that gravitational effect for the particular velocity of the round you are using at that particular distance by changing the angle of the barrel. The bullet will rise for part of the distance and then fall back down to the target. The amount of rise and fall is a function of time, so the velocity the round is traveling when it leaves the barrel matters.
Making velocity the next consideration. The faster the bullet is traveling, the further it will go in the same amount of time. A bullet may leave the barrel at 3000 feet per second, but it immediately starts slowing down. It continues to lose velocity all the way to the target. The rate it loses speed is related to it's ballistic coefficient, a measurement of how aerodynamic the bullet is. This is what can be changed. A very high ballistic coefficient coupled with a high muzzle velocity means the bullet travels further in the same amount of time. This can be calculated and there are software programs that help with the complex math involved. There are even online calculators.
Let's take one common example, 5.56 NATO. Say I zero my rifle at 180 yards. At 2900 feet per second, the bullet leaves the barrel, 2 inches below the sights. It rises due to the angle of the barrel, passing through the aiming point of the sights at approximately 46 yards. It continues to rise until it is about an inch and a half above my aiming point at about 110 yards, then begins to fall. It passes back through my point of aim at 180 yards and is 2 inches below my point of aim at 200 yards.
As you move back to longer ranges, the arc the bullet travels though becomes more pronounced. At 500 yards, your bullet will rise a couple of feet before dropping back in. It takes .6 seconds for that bullet to travel 500 yards, and when it arrives, it's only going about 1600 feet per second. You make this compensation with your sights, usually adjusting the rear sight a set number of clicks for every 100 yards further back you move. When you look through your sights, you keep the sight picture the same, so what you are doing is increasing the amount you tip up the front of the barrel, even though that is not how we usually think about it.
One piece of trivia. When the French Army sighted their rifles in at what we would call "battle zero", it was done by shooting at a white square of paper on a target backer. Whatever the weapon, the distance that put a hit on that paper square was the "point blanc". We made it point blank in English. For a military rifle, point blank range is nominally about 200 yards. Since a military shooter only needs to be able to hit a torso, elevation differences inside of point blank range are immaterial. Targets further away require sight adjustments. When I hear about someone being shot at point blank range, I always think that is pretty good shooting.
Update: From the comments, Nosmo King offers a far better definition of point blank range:
the maximum distance at which firing at a center aiming point on a target of particular size will result in a bullet strike on that target at any distance from the muzzle to the point blank range with a particular firearm using particular ammunition, absent atmosperic induced deviation.___________
This is all background, the beginning of the information you need to know to shoot a rifle accurately and be able to adjust your sights for various distances. We could talk about wind, wind direction, and wind differences 300 yards out from where you are set up. Just an 8 mph crosswind will push that same .223 bullet almost 2 and a half feet off it's point of aim at 500 yards.
And we have only considered one cartridge, with one bullet, and one velocity.