When --platform=browser, esbuild replaces process.env.NODE_ENV with "production" if minification is enabled and "development" otherwise. This exists so that React and similar libraries dead-code eliminate their development branches without configuration.
The coupling to --minify surprises people. An unminified production build gets "development" substituted, which keeps development-only warnings and slower paths in the shipped bundle. Setting it explicitly with --define:process.env.NODE_ENV=\"production\" overrides the heuristic and is what a real production build should do.
With --platform=node there is no substitution at all, because a Node process has a real process.env to read at runtime. Note that define values are parsed as JSON, so a string replacement needs quotes inside the value and therefore shell escaping. Getting that wrong replaces the expression with a bare identifier and produces ReferenceError: production is not defined in the output.