It's similar to how "Sally" is a shortened form of "Sarah," or "Billy" is a shortened form of "William."