is an expression that combines the nominalizing use of こと (creating a noun-phrase), with the 格助詞（かくじょし） (case marking particle) に
, and the う - Verb なる ‘to become’. This expression can be translated as ‘to become (A)’, but has the nuance that someone/thing caused (A) to become that way. Due to this, it may also be translated as ‘it has been decided that (A)’, or ‘it will end up being (A)’.
is primarily used with verbs and い-Adjectives
in their 連体形（れんたいけい） (attributive form). It may also be used with な-Adjectives
followed by な.
If you wait until it is too late, you are going to end up regretting it.
If you do something like that, it is going to become a huge deal.
If you don't treat it soon, it is going to end up being a bigger issue.
The ‘it has been decided that (A)’ meaning only applies to verbs, as only verbs will be enacted by someone/thing.
This structure is a good example of why なる is often viewed as the intransitive form of する. する conveys that someone is performing an action (transitive), while なる implies that something is the result of an action (intransitive). This is why the (A) phrase in ことになる is usually determined to have been decided/performed by someone else, while still focusing on exactly ‘what’ (A) became.