Even if two ingredients seem similar, you shouldn't always swap them out, but if you know the difference you can better decide which one to use. For example, crimini and portobello mushrooms are two ingredients that seem similar, and in fact, the main difference is age.
Image from sweetonveg.
Kelli Foster, writing at The Kitchn, explains how age makes the two mushrooms taste similarly, but useful for very different applications:
Both cremini and portobello mushrooms sport a dark brown colour and a smooth cap, and boast a deep savoury flavour. Despite their difference in diameter, these mushrooms look and taste pretty similar — and for good reason. The difference between these two brown mushroom is age. Portobello mushrooms are simply the mature version of cremini mushrooms harvested when they're fully grown.
Since portobellos have more time to grow, they have less moisture than criminis and a stronger earthy mushroom flavour. Portobellos also have a meaty texture that lends itself well to certain dishes like a burger topping or sliced in strips. If you're going to cut the mushroom up finely however, like in a pasta sauce, you should opt for criminis since you don't need the meaty portobello texture and you can get more criminis in a package than portobellos.