Cooking tolerates improvisation and baking generally does not, and the reason is that baking ingredients build a structure rather than contributing flavour to one.
What each ingredient does
Flour provides structure through gluten and starch.
Sugar sweetens, tenderises by interfering with gluten, retains moisture, and browns.
Fat tenderises by coating flour particles and preventing gluten formation, carries flavour and affects texture.
Eggs bind, provide structure through protein coagulation, add moisture and act as emulsifiers.
Leavening produces gas.
Liquid hydrates and dissolves.
Which means reducing sugar changes texture and browning as well as sweetness, and substituting fat changes structure.
Ratios
Classic recipes sit at ratios that produce known results.
Equal weights of flour, sugar, fat and egg produce one kind of cake. Different ratios produce biscuits, pastry or batter.
Which means recipes are variations on a small number of underlying ratios, and understanding the ratio explains why a change produces the result it does.
Mixing method
Determines the outcome as much as the ingredients.
Creaming fat and sugar incorporates air, producing a lighter result.
Rubbing fat into flour coats the particles, producing a short crumbly texture.
Whisking eggs to a foam provides structure without chemical leavening.
Which is why the same ingredients mixed differently produce entirely different things, and why the instruction to mix minimally in some recipes is a structural requirement.
Overmixing
Develops gluten, which is wanted in bread and unwanted in cake.
Which is why muffin and cake batters are mixed until just combined, and why lumps are acceptable in some batters.
The tough chewy result from overmixed cake is gluten doing exactly what it does in bread, in the wrong place.
Temperature
Ingredient temperature affects how they combine.
Butter at room temperature creams and holds air. Cold butter does not cream and does produce flaky layers in pastry.
Which means the temperature specified is a technical requirement rather than a convenience.
Oven temperature determines whether a cake rises before setting or sets before rising, which is why an oven running hot or cold produces consistent failures.
An oven thermometer costs very little and resolves a surprising number of persistent problems.
Measuring
Weighing rather than measuring by volume removes the largest source of inconsistency.
Flour in particular varies substantially by how the cup was filled, and that variation is enough to change a recipe's outcome.
Which is why professional and European recipes use weight, and why converting a volume recipe introduces error.
Substitutions that work
Like for like generally works — one fat for another with similar water content, one flour for another with similar protein.
Substitutions across categories generally do not, since the function changes.
Reducing sugar substantially, replacing fat with fruit purée, or swapping flours with different properties all change the structure and require the recipe to be adjusted rather than merely substituted.
The useful approach
Follow a recipe exactly the first time, to establish what it should produce.
Then change one thing, so the effect is attributable.
Which is how the underlying relationships become learnable, and it is faster than it sounds.
Altitude and humidity
Both affect baking measurably and are rarely mentioned in recipes.
At altitude, lower air pressure means liquids boil at lower temperatures and gases expand more, which causes cakes to rise too fast and collapse.
Adjustments involve reducing leavening, increasing liquid and raising oven temperature, and published guidance exists for specific altitudes.
Humidity affects flour, which absorbs atmospheric moisture, meaning the same weight carries different water content on different days.
Which is why experienced bakers adjust hydration by feel rather than following a recipe exactly.
Pan size and material
A batter in a different sized tin cooks differently, since depth determines heat penetration.
Dark metal absorbs more heat and browns faster. Glass heats slowly and retains heat, continuing to cook after removal.
Which means substituting a tin requires adjusting time and sometimes temperature, and the recipe assumed something specific.
Testing for doneness
A skewer test indicates whether the centre has set.
Internal temperature is more reliable, and target temperatures for different products are published and consistent.
Ageing and resting
Several doughs improve with rest, which allows hydration to complete and gluten to relax.
Cookie dough rested overnight browns better and develops flavour, which has been tested directly and the difference is noticeable.
Pastry rested before rolling shrinks less in the oven, since the gluten has relaxed rather than pulling back.
Chemical leavening
Bicarbonate of soda requires acid in the recipe to produce gas, which is why recipes using it include buttermilk, yoghurt, vinegar or cocoa.
Baking powder contains its own acid, which is why it works without one.
Which means substituting between them requires adjusting the acid, and doing it wrong produces either no rise or a soapy taste.
Which is why baking rewards note-keeping more than any other kind of cooking.