Everyone in the Netherlands has a registration number: the citizen service number (burgerservicenummer, BSN) is assigned to Dutch citizens at birth. Those newly arriving in he Netherlands will need to apply for a BSN.
A BSN is required in order to be permitted to work; open a bank account; make use of a healthcare institution; and to apply for benefits or an allowance.
A BSN number is a social security number needed to arrange all sorts of practical matters such as opening a Dutch bank account. Students often mistake the BSN number for their residence permit, and the municipality for the Dutch Immigration Service (IND). However, these are two separate institutions. The IND handles immigration matters and the municipality arranges the registrations in the town hall. You do not receive your BSN number when you have picked your residence permit at the Dutch Immigration Service (IND), but once you have registered with the municipality. So the IND and the municipality are not related. Please also note that it does not matter in which sequence you complete these practicalities; that is, you do not need a BSN number to collect your residence permit nor do you need to have your residence permit already in order to register with the municipality.