Here is a case which may explain some of the technical differences between the two. It's certainly a fine line. The argument is that pornography is paid for other people to act, sexual gratification may be part of the acting. A prostitute is paid by a person involved in exchange for sexual gratification. The creator of the porn is paying for acting services, not for his / her arousal or the actors. The fact that a third party paying for the film might be aroused is irrelevant. And if you're creating a film or photo, etc. then there is a First Amendment right of free speech and expression involved. With regard to prostitution, it's money paid to another party in exchange for an act.
There is a lot more to be read, I'm just summarizing the tidbit I know from having dealt with many online issues and questions. FWIW, here are some snippets from one of the more important cases.
People v. Freeman (1988) 46 Cal.3d 419 , 758 P.2d 1128; 250 Cal.Rptr. 598
[No. S000070. Supreme Court of California. August 25, 1988.]
The pandering statute under which defendant was convicted provides in pertinent part: "Any person who: (a) procures another person for the purpose of prostitution ... is guilty of pandering, a felony ...." fn. 4 (§ 266i.) [46 Cal.3d 424]
"Prostitution" is not defined in section 266i. Rather, the definition of "prostitution" derives from section 647, subdivision (b): "'[P]rostitution' includes any lewd act between persons for money or other consideration." (Italics added.)
[1a] The People argue that the actors and actresses in the film engaged in acts of prostitution -- i.e., sexual acts for money -- because they performed the acts before the movie cameras "for the money they received." Thus, the People argue, defendant was guilty of procuring the actors "for the purpose of prostitution." The People's syllogism is flawed in significant regards.
First, the definition of "prostitution" (and ultimately, therefore, the definition of "pandering") depends on the definition of a "lewd act." In Pryor v. Municipal Court (1979) 25 Cal.3d 238 [158 Cal.Rptr. 330, 599 P.2d 636] this court construed the term "lewd conduct" for purposes of prosecution under section 647, subdivision (a), proscribing lewd or dissolute conduct in a public place, a provision related to the prohibition against prostitution contained in section 647, subdivision (b). In Pryor we held that a "lewd act" requires "touching of the genitals, buttocks, or female breast for the purpose of sexual arousal, gratification, annoyance or offense ...." (Italics added. Id., at p. 256.) The definition of a "lewd act" for purposes of section 647, subdivision (b) evolved from Pryor and was applied to "prostitution" in People v. Hill (1980) 103 Cal.App.3d 525, at pages 534-535 [163 Cal.Rptr. 99] as follows: "[F]or a 'lewd' or 'dissolute' act to constitute 'prostitution,' the genitals, buttocks, or female breast, of either the prostitute or the customer must come in contact with some part of the body of the other for the purpose of sexual arousal or gratification of the customer or of the prostitute." (Italics added.)
One contention of defendant is that requisite to the crime of prostitution is the existence of a "customer" and there being no "customer" here, no prostitution was involved and therefore no procurement for purposes of prostitution and no pandering. We find it unnecessary to address that contention. [2] Whether or not prostitution must always involve a "customer," it is clear that in order to constitute prostitution, the money or other consideration must be paid for the purpose of sexual arousal or gratification.[1b]
The payment of acting fees was the only payment involved in the instant case. This payment was made to the actors for performing in a nonobscene film. There is no evidence that defendant paid the acting fees [46 Cal.3d 425] for the purpose of sexual arousal or gratification, his own or the actors.' Defendant, of course, did not himself participate in any of the sexual conduct. Defendant, the payor, thus did not engage in either the requisite conduct nor did he have the requisite mens rea or purpose to establish procurement for purposes of prostitution. fn. 5