The growing number of scientific publications on topology optimization (TO) shows the great interest that this technique has generated in recent years. Among the different methodologies for TO, this article focuses on the well‐known solid isotropic material penalization (SIMP) method, broadly used because of its simple formulation and efficiency. Even so, the SIMP method has certain drawbacks, namely: lack of precision in definition of the edges of the optimized geometry and final results strongly influenced by the discretization used for the finite element (FE) analyses. In this article, we propose a combination of techniques to limit the effect of these drawbacks and, thus, to improve the behavior of TO. All these techniques are based on the use of the Cartesian grid finite element method (cgFEM), an immersed boundary method whose Cartesian grid structure and hierarchical data structure makes it specially appropriate for TO. All the proposed techniques are framed under the concept of mesh refinement. First, we propose the use of two meshes, the FE analysis mesh, and a finer mesh for integration and evaluation of sensitivities, to improve the resolution of the final solution at a marginal computational cost. Then we propose two h‐adaptive mesh refinement strategies. The first one will tend to refine the elements having intermediate density values and will have the effect of sharpening the definition of the edges of the optimized geometry. We will clearly show that if the accuracy of the FE analyses is not taken into account, stress constrained TO will generate solutions that, once manufactured, will not satisfy the constraints. Hence, we also propose an h‐refinement strategy based on the estimation of the discretization error in energy norm.