I think I know the difference between the two, but see so many aberrations that I doubt if my rule is right. Machines that break down, need to be repaired Machines, which break down, need to be repaired. First, with 'that' there is no comma behind 'machines', while a comma is placed in the case of 'which'. Is this correct indeed? Secondly, the meaning of both sentences is different. The first says that only that part of the machines that break down needs repair. The second says that ALL machines will breakdown. Is this understanding in difference correct?
that's not a valid comparison... the second version is incorrect grammar... would only work if the comma-enclosed part was something like this: A machine, which can break down from overuse, will need to be repaired occasionally.
That is used in clauses where you provide information that is essential to the understanding of your sentence. Which is used when you are providing information that is helpful, but not strictly necessary to the understanding of the sentence. The sentence would still make sense without it. For example, in my sentences above, removing the phrases "that is essential" and "that is helpful" would fundamentally alter the meaning of the sentences, so I chose the word "that" instead of "which." If you are designating a person rather than an inanimate object, always use who rather than "which" or "that." There's some room for you to interpret whether or not information is essential to the understanding of your sentence, since this isn't totally objective. I hope that was somewhat helpful...
The grammar of the second one seems fine to me. The bit between the commas is a parenthetic clause and the sentence is talking about a general property of all machines.
I think the important thing to realise is that it's a matter of historical fact that there has never been a time when there has been a set of consistent and agreed rules on the difference between "which" and "that". On this subject, Fowler says "The relations between that, who and which have come to us from our forefathers as an odd jumble, and plainly show that the language has not been neatly constructed by a master builder who could create each part to do the exact work required of it, neither overlapped or overlapping; far from that, its parts have had to grow as they could." Fowler does say that "that" should be used for defining clauses and "which" for non-defining clauses, but he advocates that as an improvement to English, not as a rule of what English is, and says that "it would be idle to pretend that it is the practice either of most or of the best writers". If enough grammarians with enough influence state it as a rule then it might actually become accepted as a rule (and I suspect the grammar checker in Microsoft Word might swing the issue). But if you come across cases where "that" and "which" are used the opposite way around to what you'd expect that isn't actually wrong, it's just (all other things being equal and in the opinion of some) not as good as it might be.