wife of the last ruler of the Xia dynasty
妺 refers specifically to the wife of the last ruler of the Xia dynasty, a historical figure. Its meaning is a narrow proper-name usage rather than a general concept.
妺 combines 女 (woman) with 末, which likely serves as a phonetic component. The character is a proper name from ancient Chinese history, and its exact historical development is uncertain.
The woman radical 女 beside 末 suggests a specific woman from the end (末 can mean 'end') of a dynasty: the last Xia ruler's wife.
For バイ, imagine the wife waving bye to the dynasty as it falls: bye -> バイ, and she is the last ruler's wife.