The second sentence is correct and can be shorten to:

> What do you understand by 'better life'.

Another example:

> I understand by God's being eternal that he always has existed and always will exist.

Some words needs a preposition (by, to, of, from ...) to take an argument and if you omit that preposition the sentence become ungrammatical. Specially, if they take more than one argument:

You say:

> The Police requested a grant **from** the government.

You can't say:

> *The Police requested a grant the government.

**Understand** takes a direct object without any preposition like:

> I can understand **the lesson**.

> I understand that the God always has existed and always will exist.

In your sentence **what** plays this role and "What do you understand" is a complete sentence, but for its other argument it needs "by" preposition

 > What do you understand by 'democracy'.

 > I understand by 'democracy' that everyone has the right to to take part in the government of his country,

 > I understand that everyone has the right to to take part in the government of his country.