It's all done in batch posting I believe. Each airline sends all the other airlines a file at regular intervals that just contains info on what route a pax flew and what booking class. The receiving airline feeds that into their system and the points credit.
IE: SQ send NZ a file monthly (just assuming as an example) that contains all of the pax that few on SQ flights that month with an FQTV containing an Airpoints number. NZ loads that into the system and the APD and SP's credit based on the partner airline earning tables etc.
Some airlines might do it more regularly than others. For example a lot of Oneworld airlines send these weekly. I flew an LH flight last week that credited in a couple days so may have been lucky or they might send the file more often.