Both happened. I did already mentioned the printing press point but there's a reason y was used specifically.
The thorn character originally looked more like the letter p but with time it lost the loop at the top of the character and became more like the letter y. (See [1] in my previous post for example)
The thorn character originally looked more like the letter p but with time it lost the loop at the top of the character and became more like the letter y. (See [1] in my previous post for example)