Cats will also headbutt people or other pets that they care about. Headbutting and rubbing is a common way for cats to greet felines they’re closely bonded with.
If you regularly use your hand to play with your cat, then there’s a good chance that initiating playtime is a likely explanation for the post-headbutt bite.