How does aircraft maintain precise speed, e.g. in formation flying or refueling?
The key in holding the same speed as your wingman or the other aircraft is not to find the "perfect" throttle position, the key is to slightly adjust the throttle. 

When you look at cockpit-videos of those formation pilots (like this - move the camera to the throttle, it's a 360-degree video), you can see that they are constantly moving the throttle. They almost never stick the throttle at one position. In that way, they can slightly adjust the speed and stay in formation with the wingman for a long time.

While flying in close formation at high speed, it's the same. Little adjustments of the throttle helps the pilot to keep the same speed as the wingman-aircraft. Flaps are not used in high-speed-flying because they can only operate below a maximum speed, otherwise they could get damaged. By using the air-brake, the handling of the aircraft changes, therefore the air-brake is not used very often while flying in formation.

tl;dr:

Skill