Why does the USA have good relations with Canada but not with Mexico although both countries are USA's neighbors?

加拿大和墨西哥都是美国的邻国,为什么美国和加拿大关系很好,却和墨西哥关系不好?