[-의] is (mainly) a possessive post-position, and [-에] is (mainly) a lative post-position. They are pronounced both /so.gE/, but each post-position play its own role.

-의 is a post-position that makes an adjective phrase, with its meaning roughly equivalent to the English preposition 'of'.

-에 is a post-position that makes an adverb phrase, and it can mean in/into/to.

속 is a noun meaning the inside/interior, and also figuratively one's heart or stomach. Following another noun, it would mean "inside (the preceding noun)."

It is difficult to distinguish the difference of "속의" (of the interior?) and "속에" (in the interior?) from English translations, but the biggest difference is that -의 makes an adjective phrase but -에 makes an adverb phrase. Making an adjective phrase, -에 connects the preceding and following noun phrase to make a (bigger) noun phrase. A noun phrase is a [constituent], that is, it can function as a single grammatical unit.

---

Consider the following example:

* (1) 그물 속의 물고기가 퍼떡였다. The fish of the net-interior splashed.
  * 무엇이 퍼떡였니? What splashed? 
  * (1-1) 그물 속의 물고기. The fish of the net-interior.
* (2) 그물 속에 물고기가 퍼떡였다. The fish splashed in the net-interior.
  * 무엇이 퍼떡였니? What splashed?
  * (2-1) \*그물 속에 물고기. The fish in the net-interior.

(* marks ungrammatical.)

In the first sentence, 그물 속의 is an adjective phrase, literally translated as *of the net-interior*. So 그물 속의 물고기 would be *the fish of the net-interior*. This phrase can stand alone as a unit, so as to answer the question "What splashed?"

In the second sentence, 그물 속에 (in the net-interior) is an adverb phrase, thus cannot modify a noun. It only functions as an adverb phrase to modify the whole sentence. "물고기가 퍼떡였다. The fish splashed." Where did it splash? "그물 속에. In the net-interior." So modifying a noun "물고기" with an adverb phrase "그물 속에" would be ungrammatical.

What makes it confusing is that the English phrase "The fish in the net-interior" is perfectly grammatical (if you tolerate *net-interior* as a literal translation of 그물 속). This is only because the English preposition *in* can play two roles: one to make an adverb phrase, ("It was *in the net* that the fish splashed.") and the other to make an adjective phrase ("It was the fish *in the net* that splashed."). The Korean post-position -에 doesn't make an adjective phrase, but only an adverb phrase, so "그물 속에 물고기" is ungrammatical.

---

To summarize, post-positions -의 and -에 play different grammatical roles, -의 making an adjective phrase and -에 making an adverb phrase (and they also have different meanings). 속의 and 속에 may be confusing because of their identical pronunciation and the ambiguity of their English translations, but their grammatical roles should help you choose which post-position to use in a given context.


[-에]: https://ko.dict.naver.com/#/entry/koko/7864263b0f824097b6a7f75670060f35
[-의]: https://ko.dict.naver.com/#/entry/koko/09a51c640482464ea3e7a12ca9b896a2

[constituent]: https://en.wikipedia.org/wiki/Constituent_(linguistics)