Aquamail does not sort messages to "junk". That is done by the mail server.
Hence, Aquamail does not need to (and it does not) remember anything about messages received.
The only thing that Aquamail can do is to recover the message to a "non-junk" folder. Then the server (for those that do automatic periodic cleaning of the "junk" folder, e.g. Gmail, Yahoo, ...) does not delete that message automatically.
What happens after that (on the server) depends on the provider: I believe with some providers, if you move the message from the "junk" folder elsewhere the server may learn that and in the future that would lower the probability of the messages from the same sender getting into "junk".
A more sure way to prevent messages from the same sender to be placed in "junk" is
1. using server's web interface, to mark the message as "not junk", and
2. Put the sender's address in the "white list".
With some providers #2 might be offered right when you are doing #1.
Hope that helps.