Shelves that hold
The bracket or the wall plug decides the load. The shelf itself almost never does.

The wall, not the wood
A shelf fails at the fixing, not the timber. That is worth understanding before you buy anything, because the temptation is to focus on shelf thickness — will twelve-millimetre MDF sag under books? — when the real question is what is behind the plaster.
Solid masonry takes a rawlplug and a screw and holds without complaint. Stud walls are trickier: the void between studs will not grip a standard wall plug under any real load, so you either find the studs and fix into them, or use a dedicated cavity anchor rated for the weight you plan to put up. Tap the wall and listen — a dull thud is solid, a hollow knock is void. A stud finder, or a thin finish nail probed through the plaster, confirms it. Modern stud walls place studs at regular intervals, typically 400mm or 600mm centres, so once you find one you can locate the rest by measuring.

The plug and screw gauge has to match the bracket, the wall, and the load. A small plug and screw in a masonry wall can hold a single bracket carrying light objects. Books are a different proposition: a metre of hardback novels weighs more than most people expect, and the load is not the shelf alone but the shelf flexing under that load and levering the top fixing forward. The upper screw always takes more force than the lower one. If it is under-specified, that is where it starts.
What actually stays up
Brackets into masonry: use the right diameter rawlplug for the screw, drill to the right depth, and blow or vacuum the dust out of the hole before inserting the plug — dust is compressible, masonry is not. Into timber studs: a wood screw of adequate gauge directly into the stud, no plug needed. Into the void between studs: a cavity anchor with a rated load well above what you intend to put on it.

Level the bracket before marking the second fixing. A spirit level on the bracket, one screw loosely in, rotate until the bubble sits — then mark, drill, fix. Doing the second hole by eye against the first produces a slope you will always notice.
A stud finder, or a thin finish nail probed through the plaster, confirms it.
The shelf material matters for span, not strength. Eighteen-millimetre solid timber or good-quality ply spans up to 700mm between brackets without meaningful sag under domestic loads. Beyond that, add a bracket. The fixing to the wall is the job; everything else is carpentry.