Used after a noun (often with の) to indicate that something is determined by or varies according to that noun. Formal, often used in written or business contexts.
See also: 如何
We will decide the next policy depending on the results.
Whether the event is held depends on the weather.
次第 is more common in spoken Japanese and attaches directly to a noun or verb stem, while 如何で is more formal and often used with の.
によって is a more general and neutral way to express 'depending on', while 如何で is more formal and emphasizes the determining factor.
From the interrogative word 如何 (いかん, 'how; what kind') combined with the particle で, indicating the means or basis. The expression literally means 'by what kind of...' and developed into 'depending on'.