Lack of equity can be made up for by fold equity, or a huge skill advantage in later betting rounds. Having fold equity just means that you can expect your opponent to fold some percentage of the time when you make a bet. If you've seen people argue that you have a profitable bet heads up with only 38% equity against the opponents hand range, it means they think that the opponent will fold often enough to offset this equity disadvantage.
For example, if I have 30% equity against you and make a pot-size bet (P), and we assume you always call, and then we stop all betting and just deal out the cards to determine the winner, my expected value in the hand is
(0.30)(2P) + (0.70)(-P) = -0.1 P
That means I'd expect to lose money making this move, which makes sense because I'm betting a lot without enough equity. But, suppose everything is the same and now I expect you to fold 20% of the time when I make this bet. Then my expected value is
(0.20)(P) + (0.80)((0.30)(2P) + (0.70)(-P)) = 0.12 P
Now the expected value of this bet is positive, even though my equity is negative.
(As a side note, notice that a bet being profitable doesn't necessarily mean it's the best move. It might be profitable but less profitable than checking for example.)
If you're asking where those formulas above came from, they're the standard way to compute expected values that you'd learn in an intro statistics or probability course. You can google "expected value" or something like "how to compute expected value" to learn about it, but basically it's just multiplying the probability of each event (e.g.: winning) by the positive or negative effect on you (e.g.: how much money you win), and adding them up.