If a star accretes enough mass it collapses into a black hole (I am not a physicist or an astronomer so I guess this is the simplified version).
But what would happen if a forming planet continued to accrete mass (*)? What transformations would it undergo as it mass increases? Would it become a star? Would it still be a planet until it becomes a black hole? Or something else entirely?
If the answer is different depending if the planet is solid or gas, please consider and explain both possibilities.
(*) hypothetically, let's ignore other problems like how would it do that, or if it would be able to maintain orbit or fall into the star, etc.