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.
攻撃されたのに、冷静に行動した。 Even though (he) was attacked, he acted calmly.
攻撃された is an inflected expression (a passivized verb), hence のに.
重要な発見なのに、無視された。 Though an important discovery, it was ignored.
発見 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.
That の has a nominalizing property can be seen in other examples, such as
太郎が行かなかったのを知らなかった。 (I) didn't know that Taroo didn't go.
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).