"By" is a preposition that means:
* Near: "The house by the river"
* Through the agency of: "The book was written by Jane"
* According to: "By the rules"
* Not later than: "By 5pm"
Its use is very basic and straightforward, and doesn't have a historical or metaphorical background like many idioms.
It's possible you might be thinking of a different idiom that uses the word "by" in it, but I need more context to understand what you're referring to. Could you please provide more information?