Those are not clear questions, but i will try my best to interpret it. Pathfinding allows an object to move from one location to another while avoiding any location marked as blocked. This works thanks to a virtual grid and the pathfinder obstacle behavior: any object with that behavior will mark the cells of the virtual grid it touches as blocked. Objects with the pathfinding behavior will then search for the fastest way to go from the cell the object is on to the cell of the position selected while avoiding the blocked cells. The virtual grid system is needed to keep the algorithm performant.
Cost is often used in games to tell how much something is causing lag, as performance is seen as a resource you have a certain budget of and you cannot afford too many “expensive” functions to be used to keep your game in that budget (playable without lag).