The test pyramid is a distribution heuristic: lots of fast, cheap unit tests at the base; fewer, slower integration tests in the middle; few, expensive end-to-end tests at the top. The shape is a pyramid because the cost per test rises with the layer.
The concept was popularised by Mike Cohn in Succeeding with Agile (2009), though the drawing of three stacked layers with unit at the bottom had been circulating in the XP community for a few years before. The pyramid is not a rule; it is a diagnostic. A codebase whose test distribution matches the pyramid is easier to maintain, faster in CI, and more resilient to change. A codebase that has inverted the pyramid — heavy on end-to-end, thin on unit — is the "ice cream cone" anti-pattern, and it collapses under CI cost, flakiness and slow debugging.
The pyramid is also a communication tool. When a team argues about "how many tests should this feature have?", the pyramid answers with a rough expectation: twenty new unit tests, five new integration tests, one new E2E test. The numbers are not prescriptive; the ratio is.