You can write the editor a separate, confidential, note if you wish. Many refereeing forms have a specific area for confidential comments for the editor. Do not feel obligated to write things to the editor that you do not share with the authors. In general authors benefit from as much as you can tell them. Readers don't want to read poor pieces, and authors will benefit from revising and publishing quality work.
Papers can be poor for many reasons.
Authors may not explain themselves clearly, so the concepts, motivation, background, actual results and contributions do not come across well. The paper may require drastic proofreading. The research may be of low quality or not a significant contribution. The research may be premature to publish. It may not fit the characteristics of the intended journal or conference.