Journals published by the same publisher generally have a shared editorial system. They may actually share some or all of their editorial staff. So the second journal's editorial staff may be aware of what has been submitted to the first journal.
Moreover, different journals have different levels of prestige. A top-tier journal is not going to be able to publish every correct paper they receive, only the most interesting/important ones. If the same publisher has lower-tier journals in the same area, it often makes the most sense to resubmit papers that are rejected by the top journal to its less prestigious sibling. The peer review process can be streamlined, since the publisher typically already has access to at least one round of referee reports. This head start on the review process can speed things up, which is generally advantageous for all concerned.
So if a paper is rejected by a top journal, not because it has serious problems with the content, but because it is deemed to be not important enough, a less-prestigious sibling journal may contact the authors and suggest submitting it to the second journal instead. Sometimes, depending on the what the referees have already had to say, the lower-tier journal may offer to publish the paper without any further rounds of reviewing. (I had this happen to me once; and, in fact, I got the offer to publish the paper without change in the lower journal a few hours before I even got the rejection from the better journal.)
In this case, the editorial staff may have jumped the gun by assuming that you are automatically planning to resubmit your paper to the next journal down on the prestige ladder. However, their is otherwise nothing untoward going on. Clearly, the lower-level journal is interested in your paper, and there's a good chance that submitting it there will the best course of action to take.