What happens when butter stops foaming?
The foaming is caused by the water in the butter boiling away. The main reason you wait for it to subside is simply because that means the butter has had long enough to reach a proper temperature for cooking: too cold and the food will absorb the butter rather than fry in it. However, this usually applies more to recipes that require relatively fast cooking. You'd sweat onions or scramble eggs when the foaming starts, for example.