It does not allocate ports on behalf of those services.
Port numbers count up sequentially.
While it might be desirable, it is impossible to guarantee that any unused port, even though officially assigned to a service, is not picked by a dynamic allocator since such an assignment might occur long after the delivery of the system into a site that doesn't watch for the latest list. So programs have used this information in the past to identify whether or not the service they were talking to was started by the superuser on the remote system. Making this assumption is dangerous because not all system enforce this restriction. Sun RPC services use ports that are currently unused. If someone noted that an RPC service was using port 781, it would be just as happy using port 891, or 951.