In battle terms, messengers and flags were key. The messenger core often included the children of officers etc. This meant it wasn't a random person delivering the orders, but a trusted person.
Flags etc could also be used for simple transmission. It was often limited to predefined messages, but that was generally enough to send units around.
These 2 methods were why knowing where the commander was in a battle was so important. A big, showy banner could make them an arrow magnet. It also let everyone know where orders were coming from, and where to send reports.
The fog of war was ever present however. Messages could get lost, or misunderstood. The best commanders had highly competent underlings. A sub-commander sending in the reserves, without orders, could win or lose a battle.
As for longer ranges. There were several ways. Chains of trust were the most common. Knights etc would travel regularly. They got to know each other and so could vouch for each other's identity. This is part of where knightly honor comes from. You faked messages and both you and your family would suffer for it. The unique armour designs also helped with identification. It's hard to fake a suit of armour quickly, and taking one by force was difficult.
This also formalised into messenger cores. Various chains of trust were formed to identify imposters. Pomp and ceremony, along with expensive indicators made faking difficult, dangerous and expensive.
Another option was message relay towers. The Romans used timed lights to send messages along walls. Simple messages could be sent long distances without much risk of corruption. Semaphore towers served a similar purpose, with the ability to send complex messages. They were expensive to build and operate however, so tended to be for critical lines of communication only.
Combined with all this was a continuous arms race of message validation Vs forgeries, encryption Vs code breaking. Many cyphers were developed and broken. Things like signet rings were a classic. It's easy to seal a message with one (pressed into hot wax), and relatively hard to fake. Your seal also lived on your finger, so very difficult to steal.