BobMorane: steam_api.dll (or maybe some other steam related file) is included in the install. Why is there such a file? Is it a real full working steam file or just some placeholder because the game was originally released on steam and looks for such a file?
In essence, yes. It's not quite as simple as a placeholder (it's the actual steam_api.dll as far as I can tell), but it is inert. The game is essentially designed to use Steam but to work as best it can without it. It expects the DLL to be present either way, but well-written games will know how to handle it if the Steam service is not "available". Lazily-written games just bomb out if the Steam service can't be found.
The game calls the Steam API through steam_api.dll and performs various functions through this, such as acquiring the current Steam account and user name. It's ironically actually the Steam API's functions that tell the game that the Steam service isn't available. How the developer handles the lack of Steam service from that point is up to them. If they're completely lazy, they can just have the game terminate unceremoniously. If they're slightly lazy, they can have error messages pop up in the game but have the game work anyway. If they're clever, they can actually have the Steam features hidden from view if the Steam service cannot be initialised (I believe Anomaly 2 does this).
BobMorane: Is it even legal for gog to have steam files (or maybe dummy files with steam name) or is there a risk this might cause them troubles? Does the gog team knows some of their games come with steam stuff?
Yes, they know of its presence. As regards the legality of it, that's down to the individual developer/publisher, but I don't think Valve really has a problem with it. If it makes you feel any better, there are games on Steam that contain GOG's proprietary software (mostly Square Enix back catalogue titles that have been ripped straight from the GOG versions, but I believe there are others there as well - some DOSBox games in particular).
BobMorane: Lots of questions, i know, but this has bothered me ever since i noticed it. There was even one game that had a link on the main menu to get their DLC on steam (i think it was Eador : masters of the broken wolrd)
Yes, a few games have had the problem of blatant Steam references. Brütal Legend actually points out that Steam isn't running whenever you try to start multiplayer mode.