A window well is a pit dug against the foundation so a basement window can sit below grade. Rain falls into it, roof runoff runs into it, and snow accumulates in it.
If it drains, none of that matters. If it does not, the well fills and the window is the lowest point.

How a well should drain
A drain at the base, either connected to the footing drain or running to a dry well, with gravel above it.
Gravel fill in the base of the well, not soil, so water reaches the drain rather than sitting on a clay layer.
The gravel below the window sill, with several inches of clearance, so a partly-filled well does not reach the frame.
A cover, sloped to shed water, secured but removable without tools from inside — required where the window is an egress window.
Why they fail
The drain is blocked. Leaves, soil washed in, and silt over years. This is the most common cause by a wide margin and it is often fixable with a hose and a rod.
There was never a drain. Common on wells retrofitted, or on houses where the builder did the minimum.
Gravel has silted up, so what looks like gravel is gravel with clay between the stones, and it no longer drains.
Soil has been added around the well, raising the surrounding grade so water runs toward it.
A downspout discharges nearby, delivering roof water directly into the pit.
Testing it
Run a hose into the well for several minutes and watch. Water should disappear into the gravel steadily.
If it pools, the drain is blocked or absent, and that is the whole diagnosis.
The fixes, cheapest first
A cover. Solves rain and snow entirely, costs very little, and is often the whole answer. Ensure it is egress-compliant where the window is required for escape.
Redirect the downspout away from the well.
Clear the drain, by digging out the gravel and rodding the pipe.
Excavate and rebuild the base — remove the silted material, install a proper drain, and refill with clean washed stone.
Raise the well where the surrounding grade has risen, so the top of the well sits above the ground around it.
The window itself
An old steel casement or a single-glazed hopper in a below-grade opening is frequently the actual leak path once water reaches it. Sealing around the frame, or replacing the window, is part of the fix on an old house.
Check the frame for rot and the sill for gaps before assuming the water came through the wall.
Where it fits in the diagnosis
Water appearing under or beside a basement window, particularly after heavy rain and particularly on one elevation, is a window well problem until proven otherwise.
It is worth ruling out before anyone quotes a drainage system, because it is the cheapest fix in the whole subject and it is frequently the entire cause.
Egress requirements
Where the window serves a bedroom or a habitable basement room, the well itself has minimum dimensions — commonly 9 square feet of horizontal area with a minimum dimension of 36 inches — and a ladder or steps where it is deeper than 44 inches.
A cover on such a well must open from inside without tools or special knowledge. A screwed-down grate does not comply, however well it keeps the rain out.
Plastic wells and the retrofit trap
Corrugated plastic and composite wells are inexpensive and easy to fit, and they are frequently installed by pushing them into place against the wall without touching the base.
That produces a neat-looking well with the same silted, undrained base as before. The material of the well is irrelevant; what matters is what is underneath it, and a retrofit that did not excavate has not addressed anything.
Where a new well is being fitted, insist that the base is dug out to clean stone and the drain checked at the same time. The extra work is a fraction of the cost and it is the part that matters.
