In the first, the infinitive acts as a noun and the sentence has the same meaning as
"To understand is better" ("better" is an adjective.) You can play the same trick with any noun, though a comma is often needed:
"It is better, chocolate." = "Chocolate is better". (Without the comma, the meaning changes.)
In the second, the prepositional clause "for understanding" acts as an adverb to modify "better". It has the same meaning as
"It is, for understanding, better."
Neither sentence works if you want to express the fact that something is easy to understand. If that is what you wanted to say, you would need to use "easy" instead of "better":
"It is easy (or 'easier') to understand."
"It is easily understood."
"Understanding it is easy (or 'easier')."