Both grits and Polenta are essentially the same thing and are made from ground corn, but the main difference between Grits and Polenta is the type of corn that each is made from.
Grits and Polenta are made from different types of corn.
Polenta is made from yellow corn while grits are made from white corn.
So they are both made from corn and are somewhat the same thing but they are just made from different types of corn and have a different taste.
So if a recipe calls for grits then you want to use grits and if a recipe calls for Polenta then you would want to use Polenta so the recipe turns out good.
However it's not gonna harm anything if you use either grits or polenta instead of the specific type of corn.