Summary: Both processes depend on relative solubility of solute between high and low temperature solvent phases. How each process proceeds at sub-microscopic scale is very different. Precipitation hardening is diffusion-limited, while martensite formation is diffusionless.
Precipitation hardening is a diffusion-limited process in which (generally substitutional) solute atoms are first made to dissolve in a solvent above a eutectic or eutectoid temperature, then forced to precipitate from solution below the eutectic or eutectoid temperature. Precipitation is the result of a nucleation and growth process of a secondary phase, which relies on diffusion of solute atoms to nucleation sites. The relative rates of nucleation and growth are controlled by temperature. The size and dispersion of the secondary phase is controlled by time, with coarsening occurring as time proceeds.
Martensite is the result of a diffusionless process in which (generally interstitial) solute atoms are trapped in a transforming lattice, causing a lattice distortion. In steel, the lattice changes from FCC to BCC when transforming from austenite to ferrite. If the transformation is rapid enough, then there is not enough time for diffusion of carbon and consequent nucleation and growth of the secondary cementite phase. The carbon becomes trapped in the lattice as it changes from FCC to BCC. If carbon is beyond its solubility limit in ferrite, the lattice will eventually distort into a body-centered tetragonal (BCT) configuration. The degree of martensite formation is not controlled by time, but by temperature. Lower temperatures yield greater fraction of martensite formed. Extent of martensite formation is not controlled by diffusion because the lattice transformation to BCT occurs at the speed of sound in the material; much more rapidly than any diffusion process in solids.
The time-temperature-transformation (TTT) or isothermal transformation (IT) diagram below will help illustrate both concepts. The diagram is for an AISI 1050 steel, which is effectively just 0.5% by weight of carbon, a bit of manganese for preventing sulfur embrittlement, and the remainder is iron. At any temperature above the $A_3$ temperature, all of the carbon is fully dissolved in iron, which is fully austenitic as austenite is the stable solvent phase. Below the $A_3$ temperature austenite begins transforming into ferrite, which is now the stable solvent phase. As the iron transforms, its carbon solubility limit drops from about 0.75% by weight to about 0.02% by weight (see the Fe-C phase diagram below). Carbon therefore begins diffusing out of iron. If the process is allowed considerable time to occur while held at say, 600 C, then pearlite will form. Pearlite is a lamellar microstructure consisting of ferrite, the solvent phase, and cementite, a stoichiometric compound which is about 6.7% by weight of carbon. This is, essentially, precipitation hardening. For many materials, the secondary phase precipitates at the grain boundaries, which is undersirable. That is why a solutionization step is generally required.
If instead the steel is cooled rapidly enough to bypass the "nose" of the curved portion of the diagram, then when it reaches the $M_s$ temperature, martensite will begin to form, as sufficient carbon will still be in the lattice to cause distortion to BCT as it transforms. If cooling continues to $M_f$, then virtually the entire material will have transformed to martensite. Note that room temperature is a bit above $M_f$, so not all of the material will transform to martensite if it is only cooled to room temperature. No matter how long it is held at room temperature, the amount of martensite will not change. In contrast, if we had held the material at 600 C for a long time, the cementite in our pearliet would tend to coarsen and eventually form spherical particles as diffusion proceeds, in a process unsurprisingly called spheroidization.
Image taken from practicalmaintenance.net, which has a nice discussion of development of TTT diagrams.
Image taken from mit.edu open courseware.