In a monolith, all the code for every feature lives in one codebase and ships as one deployable unit. Sign-up, checkout, search, and billing all compile together, run in the same process, and share one database. Microservices break that single unit into many smaller services, where each service handles one slice of the business: an Order service, a Payments service, an Inventory service, a Notifications service.
The defining rule is independence. Each service has its own codebase, its own deployment pipeline, and usually its own database. No other service is allowed to reach into that database directly. If the Order service wants stock numbers, it asks the Inventory service over the network instead of running a SQL query against Inventory's tables. This is what people mean by loose coupling, and it is the whole point of the style.
A useful sizing heuristic is that a service should map to one bounded context, a term from domain-driven design. It is not about lines of code. A service is the right size when one small team can own it end to end and explain its job in a sentence.