It’s not much different from sentences like this.
This できる describes a change of state, a kind that puts something into existence somewhere. That somewhere is marked with に. This usage of に could be seen as basically the same as the standard usage of the particle in the sentence below, except the existence described will happen only as a result of the change described by the verb.
増える in your sentence works in a similar manner. As a result of the described change, Komi-san has a new friend or friends, or they come into existence in Komi-san. In fact, this state can be described as below.
(This usage of に is discussed here.)
増える doesn’t always work like that, though. For example, 人口が増える doesn’t describe a change that newly puts something into existence somewhere. It merely describes a change in some variable. So, the following sentence is a bit strange.