There is not a straightforward answer, or even a single answer, to your question unfortunately. This is because the answer depends on your specific use case, and your specific use case will be very different from another person’s.
Generally, you want to optimize based on your “working set”. It’s the part of your data that you access frequently. Note that the term “working set” is not unique to MongoDB, and is basically universal across all databases.
Here’s a couple of good explanations on what working set is:
In general, you would know the size of your working set by experimentation and expected production load of the database.
Should you discover that your working set exceeds your RAM after some experiments, then increasing RAM is the only reliable method to increase performance.
Typically, though, the default settings of the WiredTiger cache should be workable for the vast majority of use cases.