Ponds have shores, rivers have banks.
The meaning is describing how everything has boundaries and limits and rules should be respected. This is similar to “Toe the line” (i.e., following the rules) or “Draw the line” (i.e., setting a limit that must not be breached).