What is the...
Anda is very formal. I think it is similar like Usted in Spanish.
It is rarely used. I mostly see it in formal letters, commercials, or when a service company addressing their clients (for example in airlines when they asked you to fasten your seatbelt).
In nature, Anda is respectful but distance. But in daily usage, sometimes people use Anda when they are very angry and want to put themselves at a different level with their conversation partner.
Kamu is the same like you in English. You can use it to someone who has the same level like you are, such as colleague and friends, or to someone who is younger than you or have lower position than you, such as your subordinate.
So how to address someone older than me or have higher position than I am? Indonesian will use Bapak (or Pak) to men or Ibu (or Bu) to women. if the person is still young but you want to show your respect to them or that they are not your friends (for example some customer service of a company, or public servant, or a merchant down the street), you can use Mas to men or Mbak to women, or Kakak (or Kak) to both gender.
example:
This is your apple.
for friends: Ini apel kamu
for someone not your friend or older than you: Ini apel Mbak.