expression, noun-modifying (irregular), godan verb (-ru)
depending on the circumstances; it depends
Fixed expression meaning that the answer, decision, or outcome depends on the particular matter or situation. Often overlaps in everyday use with 場合による, but ことによる can sound a little more set-phrase-like.
See also: に依る
その依頼を引き受けるかどうかは、ことによる。
Whether I accept that request depends on the circumstances.
Depending on the circumstances, there may be additional costs.
expression, godan verb (-ru)
due to; caused by; resulting from
Used after a modifying verb or clause as in Vたことによる, usually to modify a following noun such as 影響, 損害, or 変化. It expresses that something is due to the fact that the preceding event happened.
システムが停止したことによる影響は大きかった。
The impact caused by the system shutdown was significant.
大雨が続いたことによる被害が各地で報告された。
Damage resulting from the continued heavy rain was reported in many areas.