Your point cloud is likely to have a shape that is complex and not square, rectangular or convex (hard to say in your image). Below a point-cloud of mine seen from above.
I don't know how
lastools estimate the density (we must dig in the source code to know) but in all case it is an estimate and many results are valid depending on how you compute the area covered by the point cloud.
In the above point-cloud we can estimate the density with:
- The number of points divided by the area of the bounding box. This is inaccurate if the point cloud is not rectangular
#>  1.74
- To be more accurate
lidR computes the convex hull of the point cloud and uses the area of this polygon as denumerator.
#>  2.71
- To be more accurate we can use a concave hull. lidR does not do that by default because it is computationally demanding but I can do it with internal tools. In this case I get
- We can also use a raster-based approach by rasterizing the density and computing the average
d = grid_density(las)
#>  3.13
lastools, for my point-cloud I get
The points 3,4 and 5 are relatively close so we can suppose that the method in
lastools is somehow based on the computation of complex hulls or on a raster-based method.
Edit based on
lasinfo source code I was able to reproduce
lastools output with
d = grid_density(las, 2)
Which is a solution that does not work for low density point cloud or longlat point-clouds