We will also slap you with a fish as part of the welcome ritual, but that's free. I think avatars are also granted as a perk to homework helpers and science advisors.

That is correct. Basically, it's for members who make a contribution (donation) to the site through upgraded membership. We decided a while back that those who contribute a lot of time and effort into being helpful here (i.e., those we've awarded science advisor and homework helper status) would be given avatars and signatures as a perk to thank them for their contribution in time and effort rather than money. So, you can either get an avatar by upgrading your membership, which helps keep the site running, or by being very helpful and posting consistently high quality information or homework help, which also helps keep the site running.