In videos like this one by electroboom, people make electromagnets with itty bitty wires. It seems the intuition is more turns, greater magnetic field. But I'm not so sure about that.
Suppose we have some annealed copper wire at 20°C. (I used this site to calculate the resistances). With wire at 1/8th of an inch and 1 foot long, the resistance is 0.6583 mΩ. If we halve the diameter, then the cross sectional area is divided by 4, the length increases by 4 times (quadrupling the number of turns), and the resistance increases 4 times per foot and 16 times over all, and is now 10.533 mΩ.
The magnetic field near a wire is given by \$B=\mu_0I/2\pi R\$ (where R is the distance from the wire, not the resistance.) In the case with 1/8th inch wire, the current will be 16 times larger, but will have 4 times fewer turns. The end result is that the magnetic field is 4 times greater with the thicker wire.
So why do people use thin wire? Is it always best to maximize number of turns and minimize wire diameter (within other engineering constraints)? Is it always best to maximize wire diameter and minimize turns? Or is this a case where we're trying to match the resistance in the inductor to something else (such as the internal resistance of the power supply, or the resistance in the rest of the circuit), and if so, what? What design considerations dictate the wire diameter?