GRAMMATICAL STRUCTURE:
If you are to be a king, you need to look after these people.
Here in this sentence the copular verb - are (auxiliary verb) - takes a non-finite to-infinitive clause (subordinate clause) as its complement. The clause is introduced by a subordinator - to (you can simply call it a infinitive marker). The Noun Phrase - a king - is the complement of the verb - be (main verb in the subordinate clause), and the implied subject of the subordinate clause is you.
SEMANTIC:
1. If you are to be a king, you need to look after these people.
2. If you are a king, you need to look after these people.
In sentence #1, you are not yet a king, but if you are going to be a king you need to look after these people.
In sentence #2, it suggests that you need to look after these people if you are already a king.
If I were a king, I had a palace. (a hypothetical situation)
I am not a king, neither I have a palace. But if I were a king, I had a palace.
You can have the same meaning with the following sentence, but I think this is very rare -
If I were to be a king, I would have a palace.
It can also be considered to be the past form of "if I am to be a king, I will have a palace".