The structure is a parallel phrase: “plant (A), get (A); plant (B), get (B).” This repetition powerfully emphasizes the one-to-one relationship between the initial action (planting a specific seed) and the final result (harvesting that specific plant). The meaning is built directly from the literal, agricultural definitions of the characters.
This idiom is extremely common and can be used in almost any context to explain the link between actions and results. It is neither formal nor informal and can be used in lectures, business meetings, parental advice, and friendly conversation.