It can also be illegal when VCs do it: "Pricing below your own costs is...a violation of the law [if] it is part of a strategy to eliminate competitors, and when that strategy has a dangerous probability of creating a monopoly for the discounting firm so that it can raise prices far into the future and recoup its losses." [1]
[1] https://www.ftc.gov/tips-advice/competition-guidance/guide-a...