The laws of logic are primarily rules of language, and thus invented by humans to make communication and information processing possible. But they work because they describe the way the universe works. If a universe worked illogically, we would not include it among the universes that can be described with logic. We would categorize such a universe as unimaginable, even unintelligible. We observe that our universe works logically, however, because it has certain physical properties.
For example, our universe contains physically distinct things (distinctions of location, time, volume, shape, powers, etc.), and the logical Law of Non-Contradiction (LNC) is simply a declaration that distinctions exist, and thus is a declaration that describes all universes in which distinctions exist, and our universe happens to be such a universe (which is why we find the LNC so useful). If the LNC ever did not apply to any region of space, we would find that region of space unintelligible to us, as it would contain no distinctions of any sort. It could not even then be a region of space, as "region" and "space" both describe distinctions. In fact, places where the LNC doesn't apply would be uninhabitable, because for any person or mind to inhabit them would require them to be physically able to sustain distinctions (as "person" and "mind" both describe entire arrays of distinguishable things), which means they must physically obey the LNC. That is why we never consider non-LNC worlds as possible worlds, because nothing would ever live there anyway, and thus understanding them is of no use to us (even if understanding them were physically possible to begin with).
The same analysis follows for every principle of logic.