There are three main reasons why these two countries are friendly with one another. Two of these reasons have to do with their historical and cultural connections and the third has to do with their relative positions in the world.
Taking the least important of these reasons first, the two countries are friendly because they are not really competitors. Canada is a rich country, but it is not a world power. Canada poses no threat to the United States. It does not threaten the US in military terms and it does not threaten to outdo the US in terms of global prestige. Since the two countries are not really competing with one another, there is little reason for them to be unfriendly.
More importantly, the two countries have strong connections. One such connection is cultural. These are two countries that have come from the same cultural background. They are both mainly English-speaking countries. They both have a tradition of government that comes from English origins. Because they are similar in their political and cultural traditions, they do not have reason to be unfriendly.
The other connection is historical. Since the War of 1812, these countries have generally been on the same side of world events. The US and Canada were on the same sides in WWI and WWII. They were on the same side in the Cold War. Because of this past, they have reason to be friendly.
Thus, the two countries have historical and cultural connections that keep them friendly. In addition, they are not competitors on the world stage and therefore have little that tends to push them apart.