I don't know how Delphi did this "magic", but I can assure you it worked and it is one that I'll really miss in Lazarus.
taazz already explained how Delphi could do (or does) this. You could try to mimic this behavior yourself by adding some code (like Delphi does) to detect the datasource of the current control.
You could use an event (OnActiveControlChange for example, if Lazarus has this one) and check if the ActiveControl has a property "DataSource". If it does you could set the DataSource of all your TDataSetAction on your form to that same DataSource (it would be just a few lines of code in the OnActiveControlChange-event). All this is assuming you have an activecontrol with a datasource. What if the activecontrol does not have a datasource? How does Delphi handle that? If there are multiple datasources on a form and your control is on a non-data-aware control.... what datasource does Delphi take then? (so many possibilities...)
Otherwise you could use the method i showed you in the last procedure of
my post.
You could even create a generic procedure to use in different programs.
(For the program you showed it was just a few lines needed to be added)
It can't be helped that Lazarus/FPC sometimes behaves slightly differently (it's not a direct clone). Sometimes these differences are deliberate (to not blindly follow Delphi in bad design/programming) and sometimes it is unintentional (or just a bug). In case it is unintentional (or a bug) you could try to code new features or patch Lazarus/FPC and see if these changes are of benefit to others. If others find the code useful it can be added to the next release.
In this case you stumbled on a (rarely used) "missing feature". You could try adding an entry in the bugtracker to see if it is deemed important enough (for others) to fix (or attach the fix yourself).