The proc yaf_user_delete sets the username/lastusername column(s) of yaf_Mesage, yaf_Topic and yaf_Forum to the username, then sets the userId to a guest's userId, sets the fromUserId of PMs to the guest's userId, then deletes everything (messages, evetns, PMs, groups, etc.) associated with the user.
Basically, the only code that ends up calling this proc is when manually deleting users. I don't know if another proc calls this one or not - so maybe a proc that does some kind of sync calls it.
Be careful using the proc - it doesn't appear finished and currently (1.9.3-RC2) has the potential to crash the app or give undesired results.