What is the meaning of [An apple a day keeps the doctor away.]

Eating an apple a day will keep you healthy.

Example: Switch from chips to apples for your snack. An apple a day keeps the doctor away.