Piece values are *empirical* quantities, which represent who has the advantage in a large collection of positions with a material imbalance (differing in the placement of the pieces). To measure them you can play a large number of games starting from an opening-like position (i.e. pieces behind a closed rank of Pawns), and observe how much the result differs from 50%.

As a caveat I want to mention the whole concept of 'piece value' is an approximation. In practice, how much a piece is worth depends on what other material you have, and what material the opponent has. Usually the corrections are small compared to the 'base value' of the piece (i.e. the value averaged over many total-material combinations with the same imbalance). But in extreme situations, the effect can be large. Seven Knights consistently beat three Queens (when they all start behind a rank of 8 Pawns, and there are no other pieces (except Kings)). This is totally at odds with the value you would observe in games between more similar armies, where a Queen on one side can be almost perfectly balanced by 3 Knights on the other side. If you take the latter as evidence that a Queen is worth 3 times as much as a Knight, you would expect the Knight side in the 3Q-7N game (which I named 'Charge of the Light Brigade') to be two Knights short of equality. But in fact the Queens stand no chance at all. A more mundane example of cooperative material effects is the Bishop pair: a Bishop is worth about half a Pawn more when you already have a Bishop on the other square shade.

Then there is an entirely different question: "can the empirical piece values be predicted from how the piece moves by a comparatively simple calculation (i.e. without playing games)". This turns out to be very difficult. Lots of methods to calculate this, which sound very plausible, turn out to give values that differ very much from the empirical value. E.g. lots of guestimates are around for the 'Capablanca pieces', the RN and BN compounds (Chancellor and Archbishop). Because every Chess player knows that a Rook is worth two Pawns more than a Bishop, these guestimates almost always have the Archbishop value ~2 Pawns below the Chancellor value. While the empirical value difference is only a quarter Pawn. (If one side has two Archbishops and a Pawn, instead of the opponent's two Chancellors, all other pieces being equal, the Archbishops usually win.) The explanation for this that I currently favor is that moves to orthogonally adjacent squares provide some extra value to the piece. (This also explains why the Rook is worth more than the Bishop, even on a cylindrical board where both have the same number of moves.)