You discuss a couple of areas, namely estimation and risk management which are a part of project management.
One is estimation which is understood as effort to plan how much time, people and resources it takes to deliver a project in given scope. Yes, the easiest approach here is guess, but that's definitely neither the best nor the only technique you can use. You can find a few more ideas on estimating in this question.
In short, estimating should be a collective effort, which means it isn't the sole responsibility of project manager but more a task for the whole team. Usually the base estimates are delivered either collectively by the a project team or individually by contributors who will actually be building specific parts of the application.
PMs responsibility is gathering all these low level estimates and building project plan basing on them, meaning arranging them in a reasonable way so people don't have conflicting tasks, anything which has to go first goes first, all dependencies between tasks are showed etc.
Another area you mention is risk management. For a reference you can start reading about identifying risks and them measuring them. With risk management it is again much of collective process. It means that every team member is entitled to identify and submit a risk and measuring them should use knowledge of the whole team and not only PM. And of course there are different people who are assigned tasks which allow to mitigate or avoid specific risks.
However typically, unlike with estimation, it is a project manager who does most of the work, keeping risk register updated, encouraging people to take part in risk management, checking updates for assigned tasks etc.
To summarize: both risk management and estimation are parts of project management. As project manager is responsible for both it's way better if they are good estimators and good risk managers. However, since risk management and estimation should be treated as collective effort PM should manage even if he's neither great estimator nor great risk manager as long as the team plays their roles in the process, e.g. preparing reasonable estimates and taking active part in risk management.