Why do people say the "coast is clear" when they really mean no one is
looking?

The expression started with ocean-going smugglers around the 1600's, and
it originally meant no one was guarding the coast and it was safe to
sail on about their journey.