because you cannot represent all decimal values exactly to 100% precision. most numbers are correct to (something like) eight significant digits. You can't actually store 0.1, but you can store 0.099999999999998590, which is usually close enough.
The reason (I think) is that
java stores number by adding up powers of 2. so to get something close to 0.1, you store 1/16+ 1/32 + 1/128.... etc. (note these are not nec. the ACTUAL sum, I'm just trying to illustrate it ).
you can get pretty close most of the time, but not exact.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors