> How is the process changed when I want a degree from it?
When you understand the answer to this question you're well on your way to a PhD. The PhD is not about implementing something. Although an implementation is sometimes/often a part of it. The real problem is to read a lot, get a grasp on what people understand about a topic, think about it, and say something new and interesting. That might mean coming up with some new algorithm, or a cool observation that solves a problem, or a theorem, or an experiment on humans that shows something interesting, etc. Finding good questions, learning how to ask them in the right way, and how to squeeze out what's actually doable and important from them, that's the point of the PhD. When you can do that from beginning to end, you're ready to graduate. Historically, this was what a PhD thesis was. Your first end-to-end piece of research.
As for the first few questions. That's why you have a PhD adviser. Someone who can help you pick your first few questions. Guide you on the path to getting answers, finding new questions, getting a handle on what's known, etc.
My biggest advice is find a topic you're interested in, read a few papers about it (google scholar is your friend), find a few people that work on that topic, read 1 paper from each, and when you apply for grad school in their department say something meaningful about what they've done (don't suck up, we know and it doesn't impress anyone) and what you would do instead/in addition. When people pick grad students they like to know that the student they're picking is smart, motivated, and knows enough to say something interesting about their work. It sounds daunting but it's doable. Particularly if you do summer research while in undergrad or do a good masters thesis. Good luck!