depending on the situation; according to circumstances
Used to express that an action or decision will be made based on how things develop. Often appears in phrases like 模様次第で決める.
Let's decide whether to go on a picnic depending on tomorrow's weather.
Depending on how the meeting goes, we may change the plan.
次第 is a suffix meaning 'depending on', while 模様次第 specifically means 'depending on the situation/state of things'.
状況次第 is a more common synonym with the same meaning, but 模様次第 can sound slightly more formal or literary.
Compound of 模様 (pattern, situation) and 次第 (depending on). The exact historical derivation is straightforward.