Facebook was on the defensive for years—until the metaverse came along