Advantages of professional (student level) memberships (in computer science)
I can only address ACM. I would think that for an undergraduate, the benefits are small, though the fees are also very small. However, if you don't otherwise have access to the ACM digital library, a membership can come with a subscription (costs a bit more, though).
The digital library has just about everything published by ACM and its special interest groups, so is pretty valuable for research and some kinds of learning.
However, it is also likely that you university library can give you access for free, though it will be a bit less convenient as you have to go through a librarian.
There might be additional advantages if your university has a local student chapter depending on how active it is.
You can read more: https://www.acm.org/membership/membership-benefits