What’s the point(lessness) of homework?

Why do teachers set homework? It is often said that it is because parents like it. I’m a parent and I have to say it sometimes drives me mad. It invades family time at the weekend and can create emotional trauma, especially when it is left until too late in the day and is confronted in an over-tired haze.