I would say the "correct conditions" for a statement are discovered by trying to prove it and seeing what you need to be true in order for the statement to follow.
Proofs are generally discovered in the opposite direction than they are written because proofs are written for elegance and conciseness, not for teaching purposes. The last thing you discover is the first step of your elegantly-presented proof. Which is why textbooks can be very confusing to students. They understand the statement of the theorem and then the proof starts with "Let blah blah be " and the student is left wondering where that came from. Well, it came from spending a long time working on the proof... and the process of discovery is almost never shown.
Sometimes the very statement of a theorem is confusing because it is not clear where they got the maddeningly detailed conditions of the theorem. They got them by starting with the conclusion and working out the proof.
And sometimes the basic definitions of an entire theory are obscure and baroque, and only much later one realises that the definition is just what one needs for a certain big theorem to be true.