Indicates that something depends on the circumstances; it varies according to the situation.
ことによると、彼はもう出発したかもしれない。
Depending on the circumstances, he may have already left.
事によるが、この計画は修正が必要になるかもしれない。
Depending on the situation, this plan may need to be revised.
事によると、旅行は中止になる可能性もある。
Depending on the circumstances, the trip might be cancelled.
Indicates that something is caused by or due to a certain matter (used like 'due to ...').
欠席は病気のことによるものです。
The absence is due to illness.
売上減少は円安のことによる影響が大きい。
The drop in sales is largely due to the weak yen.
遅刻は交通渋滞のことによるものだった。
The tardiness was due to traffic congestion.