Sweet potatoes and yams are close to one another in taste and appearance - close but no cigar. Most people easily get befuddled if asked to pick between a yam a sweet potato and vice versa, but they are not actually the same.
Nor are sweet potatoes actually potatoes. Potatoes are nightshades related to tomatoes and peppers from a botanical point of view while Sweet potatoes are related to morning glory family which comprises over 1,000 species of flowering plants. The sweet potato tubers are moister and have a higher sugar content than yams, hence they live up to their name , they are sweeter. Sweet potatoes tend to be thinner skinned than yams and the end in generally pointed / tapered.
Yams, true yams, originated in the tropics of Africa and can also be found in the Caribbean and South America. They are usually imported to North America although at times they can be grown in some regions.
Like Sweet Potatoes, Yams are not related to potatoes, they are related to lilies. Like sweet potatoes they can be orange or even purple, some varieties are white. The taste differs from sweet potatoes they have a lower moisture content and a higher starch content and are not nearly as sweet.
In the 17 and 1800's, the orange sweet potatoes were called 'nyam' a derivative of the African word for them "nyami". Nyami in the southern dialect over time shortened to yam which by coincidence was the same name for true yams and the confusion continues to this day.
A sweet potato has less fats, carbs and calories than a yam. They have more calcium and sugar as well. When cooked they are sweeter and moister. Although there are big difference between these two similar tubers some varieties are close enough to one another that they can at times be substituted for one another in some recipes - as for me I prefer sweet potato pie and not Yam pie.