The 4 wires in a phone line are for wiring 2 separate incoming phone lines.
The green and red wires in a phone line wire are for the first incoming phone line and the yellow and black wires are for the second phone line.
In telephone wire systems a four-wire telephone circuit was historically used to transport and switch baseband audio signals in the phone company telephone exchange before the advent of digital modulation and the electronic switching system eliminated baseband audio from the telco plant except for the local loop.
In telecommunication, a two-wire circuit is characterized by supporting transmission in two directions simultaneously, as opposed to four-wire circuits, which have separate pairs for transmit and receive.
Most telephone wire are one or more twisted pairs of copper wire.
The most common type is the 4-strand (2 twisted pair).
This consists of red and green wires, which makes a pair, and yellow and black wires, which makes the other pair.
One telephone wire line needs only two wires.
A 4 wire phone cable is called a RJ14 Cable and a 6 wire phone cable is called an RJ25 phone cable.
They all fit in the same size phone jack and are interchangeable, other than the number of wires.
Although they are often all called 'RJ11' cords, so you need to look closely at how many wires the cable has that you're using.
Most RJ11 cords you buy actually have 4 wires.