the first one "yo" can make pretty much any sentence into a polite sentence if you just attach it to the end. For example:
밥 먹었어. (I ate, Bab mugutsuh) is informal.
밥 먹었어요. (I ate, Bab mugutsuhyo) is formal.
You could do that with lots of other sentences, but with "니다', you have to modify the last few characters of the sentence (you can't just add "yo" to it, yo.)
With the sentence "I ate", it would be
밥먹었습니다 (I ate, babmugutseupnida)
with 니다 (nida), or
or.... using both,
밥먹었습니다요. And you can guess how the last one would be read. Again, the "yo" can be just added onto the "nida", but it's kind of old practice to use both