The modern Yamaha keyboards use samples from real pianos. In mine there is both a Yamaha and a Bosendorfer and both sound quite good. But being sample based they are essentially just playing back recorded sounds.
Pianoteq generates the sounds using nothing but a bit of software and it is really most impressive.
I've never been able to work out if Pianoteq uses physical modelling - modelling the strings and soundboard as the solutions of differential equations - or spectral modelling - overtone resynthesis, which is rooted in sampling but reassembles the harmonics in samples dynamically instead of playing back a fixed sample series at different rates.
I suspect it's the latter, because there's a hint of detail missing in the way the overtones move.
The wikipedia article[1] says it's "Fourier construction" but without reference (that I can find) and without elaboration. At their website[2] they list some of their staff; I looked up research by one of their researchers and found a paper "Modeling and simulation of a grand piano"[3] which looks quite heavy on the physical modeling of strings and soundboard. I'd expect that to work better than spectral modeling because I think the latter would introduce (too much?) latency via needing to collect an entire spectral window (plus extra computation to compute the phases, and even then I don't think it could sound good enough?). Whereas physical modeling works directly in the time domain and there's a wealth of literature around it. See e.g. J. O. Smith III's waveguide synthesis work[4].
Pianoteq generates the sounds using nothing but a bit of software and it is really most impressive.