The numbers are simply computed in with the rest of the stats in the applicable categories.
Let's say, for instance, that early in the season your guys have pitched a total of 9 innings, having allowed 8 hits and 0 walks, and 3 runs.
Then a guy comes in to pitch to one batter who hits a solo homer.
You now have the same 9 IP but have allowed 4 earned runs, and 9 hits. So your ERA goes from 3.00 to 4.00 and your WHIP goes from (I don't know exactly, but just under 1.00) to 1.00.
Naturally, the effect is less dramatic further along in the season where those stats are mixed in with much more than 9 innings of work.
A baseball fan has the digestive apparatus of a billy goat. He can, and does, devour any set of diamond statistics with insatiable appetite and then nuzzles hungrily for more. ~Arthur Daley