Cheeses in a particular pH range melt best. Too high or too low and they won't melt, but moisture content seems to be the most important factor otherwise. Lightly aged washed-curd cheeses do tend to be fairly high moisture, so they are among the best melters.
Butterfat does contribute too, though if a cheese is high butterfat and lower moisture it may be more prone to breaking (fat separation).