Breakdown of En el escaparate de la pastelería había una tarta muy grande con fresas y chocolate.
Questions & Answers about En el escaparate de la pastelería había una tarta muy grande con fresas y chocolate.
Because haber in había is being used in its existential sense: there was / there were.
So:
- Había una tarta... = There was a cake...
By contrast, estaba would describe the location or state of something already identified:
- La tarta estaba en el escaparate. = The cake was in the shop window.
A useful shortcut:
- había = there was / there were
- estaba / estaban = was / were for something specific
In this sentence, the speaker is introducing the cake as something that existed in that place, so había is the natural choice.
Because in this use, haber stays in the singular.
So Spanish says:
- Había una tarta. = There was one cake.
- Había dos tartas. = There were two cakes.
Even with a plural noun, standard Spanish normally keeps haber singular in existential sentences.
So:
- correct: Había muchas tartas
- non-standard in careful Spanish: Habían muchas tartas
This is a very common point for learners because English changes was/were, but Spanish usually does not here.