When visiting a friend's park, I sometimes see a "party hat" over a friend's dragon dens. If I click it, coins fly out. What does that do? Am I getting coins for myself, or my friend?
You get coins for it, your friend doesn't. For some reason it's always somewhere between 500 and 7,500 coins per party hat. Your level seems to determine how many coins you get. As Ebongo says it appears to be roughly X2 * 10 coins where X is your level, but not exactly.
The coins respawn daily and friends with more habitats have more chances to have coins, but the max seems to be around 5 party hats per friend. It's just a little bonus to encourage you to visit your friends daily.