Why are foxes more closely related to snakes than sea stars?

Both foxes and snakes are vertebrates while sea stars belong to a group of invertebrates called echinoderms. This means that foxes and snakes share a common ancestor (probably something resembling a lizard) which they do not share with sea stars.