They all come from Vulgar Latin and depending on how you split it but Portuguese and Gallego come from a common ancestor and one has an easier time understanding Gallego if one speaks Portuguese than if one speaks only Spanish and Catalan would be a post until itself once we start discussing Occitan and Valencian, but it’s also not descended from Spanish (Gallo-Romance)
TLDR I really wish people would stop according Castellano as an official language and a bunch of languages that are as older or older than Castellano as some dialect descending from Castellano.