APY — annual percentage yield — is the real return you earn on savings in a year, including the effect of compounding. A nominal interest rate ignores compounding; APY builds it in, which is why APY is always equal to or higher than the stated rate, and why it's the only fair way to compare accounts.
The gap comes from earning interest on your interest. If an account pays 5% compounded monthly, each month's interest starts earning its own interest, so the effective yield ends up slightly above 5%. The more often it compounds — daily beats monthly beats annually — the higher the APY for the same nominal rate.