If a course is hidden, this prevents all access by students (enrolled learners). This is useful when courses are being prepared, before they're ready for students.
You have a lot of control over this, see https://docs.moodle.org/39/en/Permissions
but it can get quite tricky. Moodle's defaults are sensible; I would be very cautious about overriding them.
It's also important to understand that a user has a role in a context -- this can be a system context (looking at a list of courses), a course context (when in a course) and so on.
So students are people who have the student role in a course. Generally your students will just have the authenticated user role at the system context, ie when looking at all the courses.
Roles can be edited and given different permissions depending on your needs, and new roles can be created.
Under Site Admin/Users/ Capability Overview you can see which roles can do what.
Capabilities relevant to your question are
moodle/categories:viewhiddencategories
moodle/course:viewhiddencourses
Managers can see hidden categories, and teachers/non editing teachers can see hidden courses (but students can't).
Moodle often has help available for individual capabilities, to understand the ramifications of changing things, but it doesn't always give a clear notion of the intent behind the capability.
https://docs.moodle.org/39/en/Capabilities/moodle/course:viewhiddencourses
https://docs.moodle.org/39/en/Capabilities/moodle/category:viewhiddencategories