What´s the origin of junk DNA?
"Junk DNA" is more aptly named noncoding DNA. This is defined as any DNA region that does not encode for a gene or more precisely is not within an open reading frame. In the human genome over 98% consists of noncoding DNA. However the more we learn about molecular biology the more we understand the biological function and importance of noncoding DNA. Examples for important functions are:


Regulatory regions that control the expression of a gene
Regions coding for regulatory RNA
Regions where epigenetic regulation takes place


However, there are also regions which likely do not have beneficial biological function, which may rightfully be called junk:


Transposons are genetic regions that can copy themselves (either by an enzymatically active RNA or by encoding for the protein transposase). They are believed to have evolved as "selfish genes" and several known defense mechanisms against rogue transposons exist (siRNA, RNAi). Transposons and the defense mechanisms have now become powerful tools in molecular biology research.
Endogenous retrovirus sequences which are remainders of retroviruses which have inserted themselves into the germ line and become inactive through mutation.


However, even these "junk" regions are believed to have important evolutionary functions such as protection from mutation through retroviruses: Because there are large DNA regions where the precise order and function is not important, a retrovirus that inserts itself at random positions of the genome is less likely to cause permanent damage.