The Pilcrow, as it is known, originated in the Middle Ages, when scribes did not use space to separate paragraphs from each other. (Space was at a premium, and spacing paragraphs had not occurred to anyone anyway.) Instead, scribes started using a Latin abbreviation to indicate a change of paragraph.
Only it wasn’t P for Paragraph. It was C for chapter (capitulum), with some lines through it.