You are missing the fact that a lot of people in Spain, maybe the majority, do what’s called a “jornada partida”, which means that businesses close at around 1-2 pm and then reopen at around 5-6 pm. During that time people generally have lunch and maybe sleep.
Especially during the hotter months, the streets are practically empty.