Traditionally caffè macchiato is made with one shot of espresso, and the small amount of added milk was the ‘stain’. However, later the ‘stain’ or ‘spot’ came to refer to the foamed milk that was put on top to indicate the beverage had milk in it. In fact, a caffè macchiato in Portuguese is named café pingado which means coffee with a drop, referring to the drop of milk.
The reason this coffee drink got its name was that the baristas needed to show the serving waiters the difference between an espresso and an espresso with a tiny bit of milk in it; the latter was ‘marked’. As the term ‘macchiato’ to describe this type of coffee predates the common usage of foam in coffee by centuries, the staining ‘agent’, the additive that lightens the dark espresso, is traditionally the milk, not the foam.