My question is out of curiosity and got me thinking. How did viruses with the head, tail and tail fibres actually evolve? These viruses look more like machines than biological entities. Are there any theories to how these viruses evolved?
I found a book chapter for you here
Quick summary: 3 hypotheses to Origin of viruses
The rest of the chapter looks more in-depth into the 3 hypotheses