If ego is an illusion, would it follow that karma is equally an illusion?
Yes. Karma and ego refer pretty much to the same thing.
Karma is not about cause and effect. This is a profound misunderstanding by the ego. There is no cause and effect other than of your own making. Karma refers to your own understanding of cause and effect, and how it relates to ego.
For example, say a partner leaves you, and you suffer. If you’re conditioned to blame yourself for your suffering, you will think you did all kinds of things wrong. That it was all your fault, and you deserve it. This is your karma. Subconsciously, it will make you much more likely to end up in situations where people treat you badly, because on some level you think that you deserve it. It’s a subtle influence on your psyche, but it’s influence nonetheless. You might even choose an abusive partner. You wouldn’t even know what’s going on and why. It may appear as some perverse destiny. Karma.
Similarly, if you’re conditioned to blame other people, you would think all kinds of bad things about your partner. You will want revenge, and might even execute on it. You will think you are a much better person than your partner. This is also your karma. Subconsciously, it will make you much more likely to be cruel and arrogant to other people, but you won’t see it. You might choose an insecure partner to have more control over them, again, subconsciously. You will be angry. And you also won’t know what’s going on. You will not understand why people are hurt by you. You will think you are right and they are wrong.
A enlightened person is free of karma, so if a partner leaves them, they do not assign blame or search for an explanation. Such is life. It happens. If they left, they wanted to. He is free and he allows everyone to be free. He might look for another partner or choose to live alone, but he does not experience an emotional reaction and doesn’t punish mentally neither himself nor other people for what has happened.
So, karma is about cause and effect, but not in the physical world, but in your mental world - as it pertains to how your ego sees itself and other people, its notions of “right” and “wrong”, and what “should” and “shouldn’t” happen to you.