Plain version: the rate is the price tag per unit of coverage; the premium is the total bill. As the policy year passes, the insurer "earns" the premium a little at a time.
Rate: the price per unit of coverage, for example $0.50 per $100 of coverage.
Premium: the total amount charged, which is the units of coverage times the rate.
Earned premium: the part of the premium for the time that has already passed.
Unearned premium: the part for the time still remaining; on a pro rata refund, this is what goes back to the insured.
Worked example: a $240,000 building at $0.50 per $100. $240,000 ÷ $100 = 2,400 units, and 2,400 × $0.50 = $1,200 of annual premium, paid in advance on January 1. The insured surrenders the policy at the end of April with no claims. Four of twelve months have passed, so earned premium is $400 and unearned premium is $800, which is refunded.
The law: California Insurance Code §481 gives the insured, on surrender, the proportion of premium matching the unexpired time, unless the contract provides otherwise. A common mistake is to stop at 2,400 units and forget to apply the rate.