I've heard that the の in のに and なのに is the general-noun の (I don't remember the word for it.). So why, in that light, does the meaning of the two make sense?
The particle construction ～（な）のに expresses the adversative, i.e. in English (al)though, even though, etc.
The の in ～のに and ～なのに is a suffix that functions as a nominalizer. の turns any inflected expression into a noun, and なの does the some for expressions that cannot be inflected. This happens in order to make the attachment of grammatical markers possible that usually do not directly attach to the expressions, or that do so with a different grammatical meaning. The に is dative/locative case, which only appear with nominals.
攻撃された is an inflected expression (a passivized verb), hence のに.
発見 cannot be inflected, hence なのに is required.
Some linguists believe that the separation of のに in の and に is not entirely correct because both particles must be present in order to express the adversative. The adversative meaning also does not follow from meaning composition, i.e. combining the nominalizing property of の with dative/locative に does not result in an adversative reading.
The clause 太郎が行かなかった 'Taroo didn't go' is nominalized, and hence the accusative case particle を can attach.
The answer to your question then is: の in ～（な）のに is a nominal particle that produces nouns, or nominal expressions. Therefore, some linguists call it a particle noun (e.g. Jens Rickmeyer).