That song was written by Bonnie Bramlett and Leon Russell, based on an idea given to them by Rita Coolidge.
Which is mentioned at the Wikipedia link provided in the title.
Band member/groupie interactions weren’t exactly isolated events back then.
Or today, for that matter.