How do rain lines work?

As we know the more wet it gets there will form rain racing lines where its dryer, to the cars form it or does it just spawn out of nowhere like in the f1 games