In a private-key cryptosystem, no matter how complex the encryption and decryption scheme is, it is required that the sender and the receiver both agree on the scheme before they can use it to communicate. This is the fundamental problem of cryptography that RSA and other public-key cryptosystem tries to solve.
In RSA, the receiver generates a public key (N, e) and a private key d using two very large primes, so large that their product is very difficult to factor. (You can refer to the details of key generation here) The key difference of RSA with the aforementioned private-key algorithm is that anyone can encrypt a message using the public key generated by the receiver and send it to anyone, but only the receiver, with the private key, can decrypt the message. For this reason, RSA is often called an asymmetric cryptosystem.